{include 'header.tpl'}
<div class="views">
    <div class="order_tab">
        <ul>
            <li {if $status == 4} class="order_ative" {/if}><a href="/seller/order/managerex"><i class="iconfont">&#xe61c;</i><span>进行中</span></a></li>
            <li {if $status == 5} class="order_ative" {/if} ><a href="/seller/order/managerex?status=5"><i class="iconfont">&#xe770;</i><span>已完成</span></a></li>
        </ul>
    </div>
    {if $order_list}
        <div class="order_cont cf">
            <ul>
                {foreach from=$order_list item=order name=foo}
                    <li>
                        <div class="order_adv">
                            <div class="order_tel cf"><a href="tel:{$order.phone}" ><span>{$order.contact}</span><span>{$order.phone}</span><i class="iconfont order_right order_blue">&#xe61b;</i></a></div>
                            <div class="order_adver"><a href="/seller/location/baidu?x={$order.lng}&y={$order.lat}"><span>收货地址：</span><span>{$order.province} {$order.city} {$order.county} {$order.address}</span><span>{$order.dis}km<i class="iconfont order_right">&#xe607;</i></span></a></div>
                            {if $status == 4}
                                <div class="order_time"><span>预计送达时间：</span><span class="order_blue">{$order.send_time}</span></div>
                            {/if}
                            {if $status == 5}
                                <div class="order_time"><span>送达时间：</span><span class="order_blue">{$order.complete_time}</span></div>
                            {/if}
                        </div>
                        <div class="order_shop">
                            <div class="money_title shop_ywy">商品信息<span class="order_right order_blue open">展开</span></div>
                            <div class="money_cont">
                                {foreach from=$order.products item=p name=foo}
                                    <p><span class="money_jl">{$p.title}</span>
                                        {if $p.spec_list}
                                            {foreach from=$p.spec_list|json_decode:true item=i name=foo}
                                                <span>{assign var=obj value=$i|json_decode:true}
                                                    {$obj.value}
                                                </span>
                                            {/foreach}
                                        {/if}
                                        <span class="order_blue">¥{$p.price_new}</span>
                                        <span class="order_right">×{$p.paynum}</span></p>
                                {/foreach}
                            </div>
                        </div>
                        <div class="order_money">
                            <div class="money_title">预计收入<span class="order_right order_blue">¥{$order.pay_price}</span></div>
                            <div class="money_title">配送费：<span class="order_right" style="color: #ff8807;">¥{$order.send_price}</span></div>
                            <div class="money_title">优惠金额:<span class="order_right" style="color: #ff8807;">¥{$order.youhui_price}</span></div>
                            <div class="money_cont">
                                <p>订单编号：{$order.o_id}</p>
                                <p>下单时间：{$order.create_time}</p>
                                <p>备注：{$order.remark}</p>
                            </div>
                        </div>
                        {if $status==4}
                            <div class="order_button"><button class="sent">已送出</button></div>
                        {/if}
                        {if $status == 5}
                            <div class="order_button"><button class="complete">已完成</button></div>
                        {/if}
                    </li>
                {/foreach}
            </ul>
        </div>
    {else}
        <div class="blank_order">
            <img src="/seller/images/kblan.png">
            <p>暂无数据...</p>
        </div>
    {/if}

    {literal}
        <script>
            $(function(){
                var isopen= false;
                $('div.order_shop .money_cont').hide();
                $('.open').click(function(){
                    $(this).parent().next('.money_cont').toggle();
                    isopen= !isopen;
                    if(isopen){
                        $(this).text("关闭");
                    }else{
                        $(this).text("展开");
                    }
                });
            });
        </script>
    {/literal}

{include 'footer.tpl'}